//
//  RCMapView.m
//  MapTest
//
//  Created by Miles on 10-05-13.
//  Copyright 2010 Miles Thorogood
//  greenmeat.net. All rights reserved.
//

#import "RCMapView.h"


@implementation RCMapView

@synthesize aMapView ;

- (id)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
		MKMapView *mapView = [[MKMapView alloc] initWithFrame:frame] ;
		//mapView.showsUserLocation = YES ;
		aMapView = mapView ;
		[self addSubview:aMapView] ;
		[mapView release] ;
    }
    return self;
}

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{
	NSLog(@"I've been tapped. Show some details.");
	if (aMapView.userLocation == annotation){
		return nil;
	}
	
	NSString *identifier = @"MY_IDENTIFIER";
	
	MKAnnotationView *annotationView = [aMapView dequeueReusableAnnotationViewWithIdentifier:identifier];

	return annotationView;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc {
	[aMapView release] ;
    [super dealloc];
}


@end
